[IA64] MAX_VIRT_CPUS and NR_CPUS
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 7 Apr 2006 17:40:33 +0000 (11:40 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 7 Apr 2006 17:40:33 +0000 (11:40 -0600)
Increase MAX_VIRT_CPUS and NR_CPUS to 64.
Check maxcpus < MAX_VIRT_CPUS.
Check size of shared_info (<= PAGE_SIZE).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
xen/arch/ia64/asm-offsets.c
xen/arch/ia64/xen/xensetup.c
xen/include/asm-ia64/config.h
xen/include/public/arch-ia64.h

index ee4148d1f00c97780a4ac5e2bfc69d021db8df4d..0bc2463dfcc5fd0f8229ad0df1c2a34ebb6f789b 100644 (file)
@@ -30,6 +30,7 @@ void foo(void)
        DEFINE(IA64_SWITCH_STACK_SIZE, sizeof (struct switch_stack));
        DEFINE(IA64_CPU_SIZE, sizeof (struct cpuinfo_ia64));
        DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info));
+       DEFINE(SHARED_INFO_SIZE, sizeof (struct shared_info));
 
        BLANK();
 #ifdef   VTI_DEBUG
index 00e7bb8079300e7d6dcdbc9d5f785bf375b66f0a..0a9e4132bea5254ab036baf9d53583516cf1ff15 100644 (file)
 #include <asm/vmx.h>
 #include <linux/efi.h>
 
+/* Be sure the struct shared_info fits on a page because it is mapped in
+   domain. */
+#if SHARED_INFO_SIZE > PAGE_SIZE
+ #error "struct shared_info does not not fit in PAGE_SIZE"
+#endif
+
 unsigned long xenheap_phys_end;
 
 char saved_command_line[COMMAND_LINE_SIZE];
@@ -321,7 +327,13 @@ printk("About to call timer_init()\n");
         //boot_cpu_data.x86_num_cores = 1;
     }
 
+    /* A vcpu is created for the idle domain on every physical cpu.
+       Limit the number of cpus to the maximum number of vcpus.  */
+    if (max_cpus > MAX_VIRT_CPUS)
+        max_cpus = MAX_VIRT_CPUS;
+
     smp_prepare_cpus(max_cpus);
+
     /* We aren't hotplug-capable yet. */
     for_each_cpu ( i )
         cpu_set(i, cpu_present_map);
index dad2335f387ae286be7a2396b4743d2048560f64..4d3437b450301a410e5a7c798832870f15805200 100644 (file)
 
 #ifdef CONFIG_XEN_SMP
 #define CONFIG_SMP 1
-#define NR_CPUS 8
-#define CONFIG_NR_CPUS 8
+#define NR_CPUS 64
 #else
 #undef CONFIG_SMP
 #define NR_CPUS 1
-#define CONFIG_NR_CPUS 1
 #endif
-//#define NR_CPUS 16
-//#define CONFIG_NR_CPUS 16
-//leave SMP for a later time
-//#undef CONFIG_SMP
+#define CONFIG_NR_CPUS NR_CPUS
 
 #define supervisor_mode_kernel (0)
 
@@ -121,9 +116,6 @@ extern char _end[]; /* standard ELF symbol */
 #define CMPXCHG_BUGCHECK_DECL
 
 // from include/asm-ia64/smp.h
-#ifdef CONFIG_SMP
-//#warning "Lots of things to fix to enable CONFIG_SMP!"
-#endif
 #define        get_cpu()       smp_processor_id()
 #define put_cpu()      do {} while(0)
 
@@ -284,13 +276,6 @@ extern int ht_per_core;
 #endif /* __ASSEMBLY__ */
 #endif /* __XEN_IA64_CONFIG_H__ */
 
-// needed for include/xen/smp.h
-//#ifdef CONFIG_SMP
-//#define raw_smp_processor_id()       current->processor
-//#else
-//#define raw_smp_processor_id()       0
-//#endif
-
 #ifndef __ASSEMBLY__
 #include <linux/linkage.h>
 #define FORCE_CRASH()  asm("break.m 0;;");
index 45e857321bafe7634cfd0a3460fe282d30a438d5..91f674b16a198503b2f13c127ee3ea9c2d7882c2 100644 (file)
@@ -31,7 +31,7 @@ DEFINE_GUEST_HANDLE(void);
 
 /* Maximum number of virtual CPUs in multi-processor guests. */
 /* WARNING: before changing this, check that shared_info fits on a page */
-#define MAX_VIRT_CPUS 4
+#define MAX_VIRT_CPUS 64
 
 #ifndef __ASSEMBLY__